<%@ Register Assembly="PHSRAG.WebControls" Namespace="PHSRAG.WebControls" TagPrefix="cc2" %>
<%@ Register Assembly="PHSRAG.Insight21.InsightWebControls" Namespace="PHSRAG.Insight21.InsightWebControls"
	TagPrefix="cc1" %>
<%@ Register Src="../FormsManagement/Controls/QuestionnaireViewer.ascx" TagName="QuestionnaireViewer"
	TagPrefix="uc1" %>

<%@ Page CodeFile="OutsideEntitySelectionPage.aspx.cs" Inherits="PHSRAG.Insight21.COI.OutsideEntitySelectionPage"
	Language="c#" MaintainScrollPositionOnPostback="true" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>COI - Outside Entity Selection</title>
	<base target="_self" />
	<link href="../Insight21.css" rel="stylesheet" type="text/css" />

	<script type="text/javascript">
    function UpdateParent(returnValue)
    {
		var entityList = document.getElementById('entityList');
		//entityList.options[entityList.selectedIndex].value + '|' + entityList.options[entityList.selectedIndex].innerText;
		window.returnValue = returnValue; 
		window.close();
    }
	</script>

</head>
<body>
	<form id="Form1" runat="server" method="post">
		<table cellpadding="0" class="Container">
			<tr>
				<td>
					<asp:Panel ID="headerSection" runat="server">
						<table cellspacing="0" width="100%">
							<tr>
								<td>
									<cc1:Header ID="header" runat="server" OnNavigate="OnHeaderNavigate" />
								</td>
							</tr>
							<tr style="display: none">
								<td>
									<cc1:CoISubNavigation ID="coiSubNavigation" runat="server" />
								</td>
							</tr>
							<tr>
								<td>
									<cc1:COISubModNavigation ID="coiSubModNavigation" runat="server" OnNavigate="OnCOISubModNavigationNavigate" />
								</td>
							</tr>
						</table>
						<br />
						<table width="100%">
							<tr>
								<td>
									<cc2:BreadCrumb ID="breadCrumb" runat="server" OnNavigate="OnBreadCrumbNavigate" HighlightCurrentPage="true" />
								</td>
							</tr>
						</table>
					</asp:Panel>
					<table>
						<tr>
							<td>
								<cc2:Annunciator ID="annunciator" runat="server" />
							</td>
						</tr>
					</table>
					<table>
						<tr>
							<td>
								<cc2:PostbackGuard ID="postbackGuard" runat="server" />
							</td>
						</tr>
					</table>
					<table>
						<tr>
							<td style="width: 2%">
							</td>
							<td>
								<table>
									<tr>
										<td>
											<asp:Label ID="outsideEntitySearchLabel" runat="server">Enter the name of the Outside Entity (you must enter at least the first character to search):</asp:Label>
											<asp:Label ID="employerSearchLabel" runat="server" Visible="False">Enter the name of the employer (you must enter at least the first character to search):</asp:Label></td>
									</tr>
									<tr>
										<td>
											<table>
												<tr>
													<td valign="top">
														<asp:TextBox ID="entityName" runat="server" CssClass="FlatTextBox"></asp:TextBox>
													</td>
													<td valign="top">
														<asp:ImageButton ID="searchEntity" runat="server" ImageUrl="../Images/b_search.gif"
															OnClick="OnSearchEntity" />
													</td>
													<td valign="top">
														<asp:RequiredFieldValidator ID="searchNameValidator" runat="server" ControlToValidate="entityName"
															ErrorMessage="Enter at least the first character to search"></asp:RequiredFieldValidator>
													</td>
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td style="height: 6px">
											&nbsp;</td>
									</tr>
									<tr>
										<td>
											<asp:Panel ID="searchResultsPanel" runat="server" Visible="False">
												<table>
													<tr>
														<td>
															<strong>Search Results</strong>
														</td>
													</tr>
													<tr>
														<td>
															<asp:Label ID="outsideEntitySearchResultsLabel" runat="server">Select Outside Entity:</asp:Label>
															<asp:Label ID="employerSearchResultsLabel" runat="server" Visible="False">Select Employer:</asp:Label></td>
													</tr>
													<tr>
														<td style="height: 90px">
															<asp:ListBox ID="entityList" runat="server" AutoPostBack="True" CssClass="FlatDropDown"
																OnSelectedIndexChanged="OnEntityListSelectedIndexChanged" Rows="5"></asp:ListBox>
															<asp:RequiredFieldValidator ID="searchResultValidator" runat="server" ControlToValidate="entityList"
																ErrorMessage="Select an Entry" InitialValue="-1"></asp:RequiredFieldValidator></td>
													</tr>
												</table>
											</asp:Panel>
										</td>
									</tr>
									<tr>
										<td>
										</td>
									</tr>
									<tr>
										<td>
											<asp:Label ID="outsideEntityAddNewLabel" runat="server">If the entity is found click continue.  If the entity is not found, click the checkbox to add a new one, enter the company name, and then click continue.</asp:Label>
											<asp:Label ID="employerAddNewLabel" runat="server" Visible="False">If the employer is found click continue. If the employer is not found, click the checkbox to add a new one, enter the company name, and then click continue.</asp:Label></td>
									</tr>
									<tr>
										<td>
											<asp:CheckBox ID="addEntity" runat="server" AutoPostBack="True" Enabled="False" OnCheckedChanged="OnAddEntityCheckedChanged"
												Text="Add New" />
										</td>
									</tr>
									<tr>
										<td>
											<asp:TextBox ID="newEntityName" runat="server" CssClass="FlatTextBox" Enabled="False"></asp:TextBox>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td style="height: 6px">
								&nbsp;</td>
						</tr>
						<tr align="right">
							<td style="width: 2%">
							</td>
							<td>
								<table>
									<tr align="left" style="width: 100%">
										<td valign="top">
											<asp:ImageButton ID="cancel" runat="server" CausesValidation="False" ImageUrl="../Images/b_cancel.gif"
												OnClick="OnCancel" /></td>
										<td valign="top">
											<asp:ImageButton ID="save" runat="server" CausesValidation="False" ImageUrl="../Images/b_continue.gif"
												OnClick="OnSave" />
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
